package com.atguigu.springcloud.controller;

import com.atguigu.springcloud.service.FeignFallBackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;


/**
 * 模拟客户端宕机，针对feignClint注解的接口，实现降级处理
 * @author timiv
 */
@RestController
public class FeignFallbackController {

    @Autowired
    private FeignFallBackService fallBackService;

    @GetMapping("/consumer/payment/feign/hystrix/ok/{id}")
    public String payment_ok(@PathVariable("id") Integer id) {
        return fallBackService.payment_ok(id);
    }
}
